package cj.web.marriage.dao;
/*
 *  
 *  
*/
import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import cj.web.marriage.domain.RefAddressAutho;

/**
 * 
 * @author 
 *
 */
@DAO
public interface RefAddressAuthoDAO{
	
	@SQL("SELECT * FROM RefAddressAutho WHERE addressId=:1 ")
    List<RefAddressAutho> queryByAddressId(int addressId);
	
	@SQL("SELECT addressId FROM RefAddressAutho WHERE userId=:1 ")
    List<Integer> queryByUserId(int userId);
	
    @SQL("SELECT count(1) FROM RefAddressAutho WHERE addressId=:1 and userId=:2 ")
    int querySize(int addressId,int userId);
    
    @SQL("INSERT INTO RefAddressAutho (addressId,userId) VALUES (:1,:2) ")
    void create(int addressId,int userId);
	
    @SQL("DELETE FROM RefAddressAutho WHERE addressId=:1 ")
    void deleteByAddressId(int addressId);
}